<?php

namespace App\Model;


use Illuminate\Http\Request;

class Version extends BaseModel
{
    protected $table = 'system_version';
    public $timestamps = false;
    protected $fillable = ['version_id','describe','platform_id','download_url','channel_id','upgrade_type','audit_switch','create_time'];
    private $fields = ['*'];
    
    public function getList(Request $request){
        $limit = $request->input('limit', 10);
        $page = $request->input('page', 1);
        
        $query = new Version();
        
        // todo 搜索
        
        return $query->orderBy('id','desc')->paginate($limit, ['*'], 'page', $page);
    }


    //添加
    public function createData($data)
    {
        return curl_request(getKkaudioApiUrl() . '/inner/system/version/create', $data, 'json', 'POST');
    }

    //更新
    public function updateData($data)
    {
        return curl_request(getKkaudioApiUrl() . '/inner/system/version/update', $data, 'json', 'POST');
    }

    //删除
    public function removeData($data)
    {
        return curl_request(getKkaudioApiUrl() . '/inner/system/version/remove', $data, 'urlencoded', 'GET');
    }

}
